<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      div,
      ul,
      li,
      span {
        margin: 0;
        padding: 0;
      }
      ul {
        list-style: none;
      }
      .container {
        width: 200px;
        margin: 0 auto;
        line-height: 30px;
      }
      .menu {
        background-color: lightblue;
        margin: 20px 0;
      }
      .menu span {
        display: block;
        padding: 0 25px;
        cursor: pointer;
      }
      .sub-menu {
        background-color: #e0f0f7;
        padding: 0 30px;
        overflow: hidden;
        height: 0;
      }
      .sub-menu li {
        height: 30px;
      }
    </style>
  </head>
  <body>
    <div class="container">
      <ul>
        <li class="menu">
          <span>菜单1</span>
          <ul class="sub-menu">
            <li>菜单1</li>
            <li>菜单2</li>
            <li>菜单3</li>
            <li>菜单4</li>
          </ul>
        </li>
        <li class="menu">
          <span>菜单2</span>
          <ul class="sub-menu">
            <li>菜单1</li>
            <li>菜单2</li>
            <li>菜单3</li>
            <li>菜单4</li>
          </ul>
        </li>
        <li class="menu">
          <span>菜单3</span>
          <ul class="sub-menu">
            <li>菜单1</li>
            <li>菜单2</li>
            <li>菜单3</li>
            <li>菜单4</li>
          </ul>
        </li>
        <li class="menu">
          <span>菜单4</span>
          <ul class="sub-menu">
            <li>菜单1</li>
            <li>菜单2</li>
            <li>菜单3</li>
            <li>菜单4</li>
          </ul>
        </li>
      </ul>
    </div>
    <script src="../tool.js"></script>
    <script src="./index.js"></script>
  </body>
</html>
